import request from "@/utils/request";

// 登录
export const login = (data) => {
  return request({
    method: "post",
    url: "/user/login",
    data,
  });
};

// 退出
export const logout = () => {
  return request({
    method: "GET",
    url: "/user/logout",
  });
};

// 注册
export const register = (data) => {
  return request({
    method: "POST",
    url: "/user/register",
    data,
  });
};

// 获取验证码
export const code = () => {
  return request({
    method: "GET",
    url: "/user/code",
  });
};

// 获取用户信息
export const getUserInfo = () => {
  return request({
    method: "GET",
    url: "/user/profile",
  });
};
